﻿
//********************************************************************************//
//创建日期：<创建日期，2016-4-12>
//页面创建：<孙雪婷，sunxueting@shanghai3h.com>
//后台逻辑：<张晨斐，zhangchenfei@shanghai3h.com>
//功能说明：进入下一账务年月
//********************************************************************************//
using System;
using Web.Class;
using Entity;
using BLL;

namespace Web.Pages.YongShui._7.ZhangWuGL
{
    public partial class JinRuXYZWNY : BasePage
    {
        #region 变量
        /// <summary>
        /// 系统参数操作类
        /// </summary>
        S_SETTINGSBLL _S_SETTINGBLL = new S_SETTINGSBLL();
        /// <summary>
        /// 系统参数实体
        /// </summary>
        private static S_SETTINGS _S_SETTINGS;
        /// <summary>
        /// 日志操作类
        /// </summary>
        SYS_LOGBLL _SYS_LOGBLL = new SYS_LOGBLL();
        string aaa = "";
        #endregion
        #region 事件
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitControl();
                InitData();
            }
        }

        protected void btnJinRuXYZWNY_Click(object sender, EventArgs e)
        {
            string _ConfirmMsg = "确认要进入下一账务年月吗？";
            PageTools.ConfirmMsg(this, _ConfirmMsg, "btnJinRuXYZWNYFact");
        }

        /// <summary>
        /// 执行进入下一水量年月操作
        /// </summary>
        protected void btnJinRuXYZWNYFact_Click(object sender, EventArgs e)
        {
            //判断用户是否确认
            if (Convert.ToBoolean(this.confirmValue.Value))
            {
                string _ErrMsg = _S_SETTINGBLL.JinRuXiaYiZhangWuNY(_S_SETTINGS);
                if (string.IsNullOrEmpty(_ErrMsg))
                {
                    try
                    {
                        _SYS_LOGBLL.Log<S_SETTINGS>(LoginInfo.CurrentUser, BusinessTool.WType.ToString(), "账务年月", OperateState.Modify, _S_SETTINGS, null);
                    }
                    finally
                    {
                        this.txtZhangWuNY.Text = _S_SETTINGS.CONFIGVALUE;
                        PageTools.AlertMsg(this, "成功进入下一账务年月！");
                    }
                }
                else
                {
                    PageTools.AlertMsg(this, "进入下一账务年月失败！原因：" + _ErrMsg);
                }
            }
        }
        #endregion
        #region 私有方法
        private void InitControl()
        {
            this.txtZhangWuNY.Enabled = false;
        }
        private void InitData()
        {
            _S_SETTINGS = _S_SETTINGBLL.GetCurrentZhangWuNY();
            this.txtZhangWuNY.Text = _S_SETTINGS.CONFIGVALUE;
        }
        #endregion
    }
}